﻿using System;
using System.IO;
using System.Web;
using System.Web.UI.HtmlControls;
using AnyOffice.Components;
using AnyOffice.general.qikan;
namespace AnyOffice.general.qikan
{

    public partial class read : ModulePage
    {
        public string _filename = string.Empty;
        public string _op = "0";
        public string _path = string.Empty;
        public string _username = string.Empty;
        public string filePrint = "0";
        public string isNoCopy = "0";
        public bool isppt;  
        public string url = string.Empty;
        protected void Page_Load(object sender, EventArgs e)
        {
            QikanInfo qikanInfo = QikanFactory.GetQikanInfo();
            if ((qikanInfo != null) && qikanInfo.CanRead)
            {
                string s = (Request.QueryString["filename"] != null) ? Request.QueryString["filename"].ToString() : "";
                this.url = "readdisk.aspx?filename=" + Server.UrlEncode(s);
                this._path = s;
                s = s.Replace("../", "").Replace("/", @"\");
                FileInfo info2 = new FileInfo(qikanInfo.DiskPath + s);
                this._filename = info2.Name;
                if (this._filename.ToLower().EndsWith(".ppt") || this._filename.ToLower().EndsWith(".pptx"))
                {
                    this.isppt = true;
                }
                if (qikanInfo.CanCopy)
                {
                    this.isNoCopy = "0";
                    this._op = "1";
                }
                else
                {
                    this.isNoCopy = "-1";
                }
                if (qikanInfo.CanPrint)
                {
                    this.filePrint = "-1";
                }
                UserCache cache = new UserCache();
                this._username = cache.UserName;
            }

        }
    }
}
